home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / p4 / p4-1_2a.lha / p4-1.2a / lib / p4_sr.h < prev    next >
C/C++ Source or Header  |  1992-10-19  |  2KB  |  68 lines

  1. struct p4_msg_queue {
  2.     p4_monitor_t m;
  3.     p4_lock_t ack_lock;
  4.     struct p4_queued_msg *first_msg, *last_msg;
  5. };
  6.  
  7. #define CONN_ME         1
  8. #define CONN_REMOTE_SWITCH     2
  9. #define CONN_REMOTE_NON_EST     3
  10. #define CONN_REMOTE_EST     4
  11. #define CONN_SHMEM         5
  12. #define CONN_CUBE         6
  13. #define CONN_TCMP         7
  14. #define CONN_REMOTE_DYING       8
  15.  
  16. #define P4_MAX_MSGLEN (1<<26)  /* Used in free_p4_msg as sanity check
  17.                   increase as desired */
  18.  
  19. /* Returns true if node is out of allowed range */
  20. #define CHECKNODE(node) ((node<0) || (node>=p4_num_total_ids()))
  21.  
  22. #if defined(IPSC860) || defined(CM5)
  23. #    define CONN_LOCAL CONN_CUBE
  24. #else
  25. #    if defined(TCMP)
  26. #        define CONN_LOCAL CONN_TCMP
  27. #    else
  28. #        define CONN_LOCAL CONN_SHMEM
  29. #    endif
  30. #endif
  31.  
  32. #define XDR_PAD 4
  33. #define XDR_INT_LEN 4
  34. #define XDR_LNG_LEN 4
  35. #define XDR_FLT_LEN 4
  36. #define XDR_DBL_LEN 8
  37. #define XDR_CHR_LEN 4
  38. #define XDR_BUFF_LEN 4096
  39.  
  40. /* data types typically used by xdr, but also for other purposes */
  41. #define P4NOX 0
  42. #define P4INT 1
  43. #define P4LNG 2
  44. #define P4FLT 3
  45. #define P4DBL 4
  46.  
  47.  
  48. /* send_message(type,from,to,msg,len,data_type,ack_req,p4_buff_ind) */
  49.  
  50. #define  p4_send(TYPE,TO,MSG,LEN)  \
  51.     send_message(TYPE,p4_get_my_id(),TO,MSG,LEN,P4NOX,FALSE,FALSE)
  52. #define  p4_sendr(TYPE,TO,MSG,LEN)  \
  53.     send_message(TYPE,p4_get_my_id(),TO,MSG,LEN,P4NOX,TRUE,FALSE)
  54. #define  p4_sendx(TYPE,TO,MSG,LEN,DATATYPE)  \
  55.     send_message(TYPE,p4_get_my_id(),TO,MSG,LEN,DATATYPE,FALSE,FALSE)
  56. #define  p4_sendrx(TYPE,TO,MSG,LEN,DATATYPE)  \
  57.     send_message(TYPE,p4_get_my_id(),TO,MSG,LEN,DATATYPE,TRUE,FALSE)
  58. #define  p4_sendb(TYPE,TO,MSG,LEN)  \
  59.     send_message(TYPE,p4_get_my_id(),TO,MSG,LEN,P4NOX,FALSE,TRUE)
  60. #define  p4_sendbr(TYPE,TO,MSG,LEN)  \
  61.     send_message(TYPE,p4_get_my_id(),TO,MSG,LEN,P4NOX,TRUE,TRUE)
  62. #define  p4_sendbx(TYPE,TO,MSG,LEN,DATATYPE)  \
  63.     send_message(TYPE,p4_get_my_id(),TO,MSG,LEN,DATATYPE,FALSE,TRUE)
  64. #define  p4_sendbrx(TYPE,TO,MSG,LEN,DATATYPE)  \
  65.     send_message(TYPE,p4_get_my_id(),TO,MSG,LEN,DATATYPE,TRUE,TRUE)
  66.  
  67. #define  p4_broadcast(TYPE,MSG,LEN)  p4_broadcastx(TYPE,MSG,LEN,P4NOX)
  68.